<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="csrf-token" content="{{ csrf_token() }}">
<title></title>
 <link rel="stylesheet" href="/css_system/common.css" />
 <link rel="stylesheet" href="/css_system/main.css" />
 <link href="/js_system/jQueryUI/jquery-ui.css" rel="stylesheet">
    <!-- 编辑器 -->
<script type="text/javascript" src="/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="/ckfinder/ckfinder.js"></script>
 <!-- 对话框 -->
<link rel="stylesheet" href="/js_system/easydialog/easydialog.css" />
<script type="text/javascript" src="/js_system/easydialog/easydialog.js"></script>
<script type="text/javascript" src="/js_system/cueeasy.js"></script>
<script type="text/javascript" src="/js_system/jquery.min.js"></script>

 <!-- 上传图片 -->
<script type="text/javascript" src="/uploadify/jquery.uploadify.js" ></script>
<link rel="stylesheet" type="text/css" href="/uploadify/uploadify.css">
<script type="text/javascript" src="/js_system/booksrecommend.js"></script>
</head>
    <body>
  <div class="container">
            <div class="location clearfix">
                     <div class="here_area fl"><strong>当前位置：</strong>资讯管理&nbsp;&nbsp;&raquo;&nbsp;&nbsp;文章列表</div>
                <div class="here_btn fr">
                    <a href="javascript:history.back()" class="btn btn_back">返回</a>
                    <a href="javascript:;" onclick="location.replace(location.href);" class="btn btn_refresh">刷新</a>
                </div>
            </div>
            <div id="tabs">
                <ul>
                    <li><a href="#tabs-1">基本信息</a></li>
                    <li><a href="#tabs-2">文件管理</a></li>
                    <li><a href="#tabs-3">图片管理</a></li>
                </ul>
            	<form action="/admin_system/books/indexedit/{{$entBookInfo->BookID}}" method="post">
                    <div id="tabs-1">
                        @include('common.errors')
                        <table class="dataTable">
                            <input type="hidden" name="_token" value="<?php echo csrf_token(); ?>">
                            <tbody>
                            <tr>
                                <td class="ltd">书籍类别</td>
                                <td class="rtd">
                                    <select style="width:200px;" class="select" id="TypeIDSelect" name="TypeIDSelect">
                                        <option value="0">请选择</option>
                                        @foreach($SelectType as $select)
                                            @if($select->TypeID==$entBookInfo->TypeID)
                                                <option selected="selected" value="{{$select->TypeID}}">&nbsp;&nbsp;{{$select->TypeName}}</option>
                                                @else
                                                <option value="{{$select->TypeID}}">&nbsp;&nbsp;{{$select->TypeName}}</option>
                                                @endif

                                        @endforeach
                                    </select>
                                    <span class="text-red pl10">*必选</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">书籍名称</td>
                                <td class="rtd">
                                    <input id="txtBookTitle" value="{{$entBookInfo->BookTitle}}" class="input-text" type="text" name="txtBookTitle" />
                                    <span class="text-red pl10">*必填</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">简介</td>
                                <td class="rtd">
                                    <textarea style="width: 500px;" class="textarea" id="txtBookDesc" cols="20" rows="8" name="txtBookDesc">{{$entBookInfo->BookDesc}}</textarea>
                                    <span class="text-red pl10">内容20个汉字以内</span>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">视频URL</td>
                                <td class="rtd">
                            <textarea style="width: 500px;" class="textarea"  id="txtVideoUrl" cols="20" rows="8"
                                      name="txtVideoUrl">{{$entBookInfo->FilePath2}}</textarea>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">音频URL</td>
                                <td class="rtd">
                            <textarea style="width: 500px;" class="textarea"  id="txtAudioUrl" cols="20" rows="8"
                                      name="txtAudioUrl">{{$entBookInfo->FilePath3}}</textarea>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">是否免费</td>
                                <td class="rtd">
                                   <span class="Radio">
                                               <?php $IsGratis=$entBookInfo->IsGratis;?>
                                         <input id="RadIsGratis1"  type="radio" value="1" <?php if($IsGratis==1){ echo 'checked="checked"';}  ?>  name="RadIsGratis" /><label for="RadIsGratis1">是</label>
	                                    <input id="RadIsGratis0" type="radio" value="0" <?php if($IsGratis==0){ echo 'checked="checked"';} ?>  name="RadIsGratis" /><label for="RadIsGratis0">否</label>
                                    </span>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">显示 / 隐藏</td>
                                <td class="rtd">
                                    <span class="Radio">
	                                   <?php $IsShow=$entBookInfo->IsShow;?>
                                        <input id="RadIsShow1"  type="radio" value="1" <?php if($IsShow==1){ echo 'checked="checked"';}  ?>  name="RadIsShow" /><label for="RadIsShow1">显示</label>
	                                    <input id="RadIsShow0" type="radio" value="0" <?php if($IsShow==0){ echo 'checked="checked"';} ?>  name="RadIsShow" /><label for="RadIsShow0">隐藏</label>
	                                 </span>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">排序</td>
                                <td class="rtd">
                                    <input id="txtSortNumber"  value="{{$entBookInfo->SortNumber}}" class="input-text" style="width: 50px;" type="text" name="txtSortNumber" />
                                    <span class="text-red pl10">*必填</span>
                                </td>
                            </tr>
                            </tbody>

                        </table>
                    </div>
                    <div id="tabs-2">

                        <table class="dataTable">
                            <tbody>
                            <tr>
                                <td class="ltd">列表图片<br/></td>
                                <td class="rtd">
                                    <div class="PreviewImg">
                                        <div id="PreviewImgs"
                                             style="padding:0px; background:#fff url(/images_system/yulan.gif) no-repeat center;"
                                             class="PreviewTD delfile_1">
                                            @if($entBookInfo->FilePath1!='')<a target="_blank" href="{{$entBookInfo->FilePath1}}"><img src="{{$entBookInfo->FilePath1}}"></a>@endif
                                        </div>
                                    </div>
                                    <input type="hidden" id="File_1" value="{{$entBookInfo->FilePath1}}" name="File_1">
                                    <input id="file_upload" name="file_upload" type="file">
                                    @if($entBookInfo->FilePath1=='')
                                        <a id="addvideoFile_1" style="font-weight:normal;color:#FFF; " class="button button-primary"
                                           href="javascript:$('#file_upload').uploadify('upload','*');">上传</a>
                                        <a id="delvideoFile_1" style="font-weight:normal;color:#FFF; display: none;" onclick="delFile(1);" class="button button-primary"
                                           href="javascript:void(0);">删除</a>
                                        @else
                                        <a id="addvideoFile_1" style="font-weight:normal;color:#FFF; display: none;" class="button button-primary"
                                           href="javascript:$('#file_upload').uploadify('upload','*');">上传</a>
                                        <a id="delvideoFile_1" style="font-weight:normal;color:#FFF; " onclick="delFile(1);" class="button button-primary"
                                           href="javascript:void(0);">删除</a>
                                        @endif


                                    <script type="text/javascript">
                                        <?php $timestamp = time();?>
                                        $(function () {
                                            $('#file_upload').uploadify({
                                                'buttonText': "请选择文件",
                                                'fileTypeExts': '*.jpg;*.gif;*.png;*.jpeg',
                                                'auto': false,
                                                'formData': {
                                                    'timestamp': '<?php echo $timestamp;?>',
                                                    'token': '<?php echo md5('unique_salt' . $timestamp);?>'
                                                },
                                                'swf': '/uploadify/uploadify.swf',
                                                'uploader': '/uploadify/uploadify.php',
                                                'onUploadSuccess': function (file, data, response) {
                                                    if (data != '') {
                                                        $('#File_1').val(data);
                                                        $('#addvideoFile_1').hide();
                                                        $('#delvideoFile_1').show();
                                                        $('#PreviewImgs').html('<a target="_blank" href=' + data + '><img src=' + data + '></a>');
                                                    }
                                                }
                                            });
                                        });
                                    </script>

                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">视频文件<br/></td>
                                <td class="rtd">
                                    
                                        <p class="PreviewTD media-box delfile_2">
                                            <span class="media-tit">视频文件名称：</span><br/><span id="videoFileID" class="media-name">{{$entBookInfo->FilePath2}}</span>
                                        </p>
                                    
                                    <input type="hidden" id="File_2" value="{{$entBookInfo->FilePath2}}" name="File_2">
                                    <input id="video_file_upload" name="video_file_upload" type="file">
                                    @if($entBookInfo->FilePath2=='')
                                        <a id="addvideoFile_2" style="font-weight:normal;color:#FFF; " class="button button-primary"
                                           href="javascript:$('#video_file_upload').uploadify('upload','*');">上传</a>
                                        <a id="delvideoFile_2" style="font-weight:normal;color:#FFF; display: none;" onclick="delFile(2);" class="button button-primary"
                                           href="javascript:void(0);">删除</a>
                                        @else
                                        <a id="addvideoFile_2" style="font-weight:normal;color:#FFF;  display: none;" class="button button-primary"
                                           href="javascript:$('#video_file_upload').uploadify('upload','*');">上传</a>
                                        <a id="delvideoFile_2" style="font-weight:normal;color:#FFF;" onclick="delFile(2);" class="button button-primary"
                                           href="javascript:void(0);">删除</a>
                                        @endif


                                    <script type="text/javascript">
                                        <?php $videotimestamp = time();?>
                                        $(function () {
                                            $('#video_file_upload').uploadify({
                                                'buttonText': "请选择文件",
                                                'fileTypeExts': '*.mp4;*.flv;',
                                                'auto': false,
                                                'formData': {
                                                    'timestamp': '<?php echo $videotimestamp;?>',
                                                    'token': '<?php echo md5('unique_salt' . $videotimestamp);?>'
                                                },
                                                'swf': '/uploadify/uploadify.swf',
                                                'uploader': '/uploadify/uploadify.php',
                                                'onUploadSuccess': function (file, data, response) {
                                                    if (data != '') {
                                                        $('#File_2').val(data);
                                                        $('#videoFileID').html(data);
                                                        $('#addvideoFile_2').hide();
                                                        $('#delvideoFile_2').show();
                                                    }
                                                }
                                            });
                                        });
                                    </script>

                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">音频文件<br/></td>
                                <td class="rtd">
                                    
                                    <p class="PreviewTD media-box delfile_3">
                                            <span class="media-tit">音频文件名称：</span><br/><span id="audioFileID" class="media-name ">{{$entBookInfo->FilePath3}}</span>
                                        </p>
                                    <input type="hidden" id="File_3" value="{{$entBookInfo->FilePath3}}" name="File_3">
                                    <input id="audio_file_upload" name="audio_file_upload" type="file">
                                    @if($entBookInfo->FilePath3=='')
                                        <a id="addvideoFile_3" style="font-weight:normal;color:#FFF; " class="button button-primary"
                                           href="javascript:$('#audio_file_upload').uploadify('upload','*');">上传</a>
                                        <a id="delvideoFile_3" style="font-weight:normal;color:#FFF; display: none;" onclick="delFile(3);" class="button button-primary"
                                           href="javascript:void(0);">删除</a>
                                        @else
                                        <a id="addvideoFile_3" style="font-weight:normal;color:#FFF;  display: none;" class="button button-primary"
                                           href="javascript:$('#audio_file_upload').uploadify('upload','*');">上传</a>
                                        <a id="delvideoFile_3" style="font-weight:normal;color:#FFF;" onclick="delFile(3);" class="button button-primary"
                                           href="javascript:void(0);">删除</a>
                                        @endif


                                    <script type="text/javascript">
                                        <?php $audiotimestamp = time();?>
                                        $(function () {
                                            $('#audio_file_upload').uploadify({
                                                'buttonText': "请选择文件",
                                                'fileTypeExts': '*.mp3',
                                                'auto': false,
                                                'formData': {
                                                    'timestamp': '<?php echo $audiotimestamp;?>',
                                                    'token': '<?php echo md5('unique_salt' . $audiotimestamp);?>'
                                                },
                                                'swf': '/uploadify/uploadify.swf',
                                                'uploader': '/uploadify/uploadify.php',
                                                'onUploadSuccess': function (file, data, response) {
                                                    if (data != '') {
                                                        $('#File_3').val(data);
                                                        $('#audioFileID').html(data);
                                                        $('#addvideoFile_3').hide();
                                                        $('#delvideoFile_3').show();
                                                    }
                                                }
                                            });
                                        });
                                    </script>

                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div id="tabs-3">
                        <input type="hidden" value="{{$entBookInfo->BookID}}" id="hiImgID" name="hiImgID">
                        <table class="dataTable">
                            <tbody>
                            <tr>
                                <td class="ltd">排序<br/></td>
                                <td class="rtd">
                                    <input id="txtPPTSortNumber" value="1000" class="input-text" style="width: 50px;" type="text" name="txtPPTSortNumber"/>
                                </td>
                            </tr>
                            <tr>
                                <td class="ltd">PPT图片<br/></td>
                                <td class="rtd">
                                    <div class="PreviewImg">
                                        <div id="PreviewPPT"
                                             style="padding:0px; background:#fff url(/images_system/yulan.gif) no-repeat center;"
                                             class="PreviewTD"></div>
                                    </div>
                                    <input type="hidden" id="File_4" name="File_4">
                                    <input id="PPT_file_upload" name="PPT_file_upload" type="file">
                                    <a id="addvideoFile_4" style="font-weight:normal;color:#FFF; " class="button button-primary"
                                       href="javascript:$('#PPT_file_upload').uploadify('upload','*');">上传</a>
                                    <a id="delvideoFile_4" style="font-weight:normal;color:#FFF; display: none;" onclick="delFile(4);" class="button button-primary"
                                       href="javascript:void(0);">删除</a>
                                    <script type="text/javascript">
                                        <?php $timestamp = time();?>
                                        $(function () {
                                            $('#PPT_file_upload').uploadify({
                                                'buttonText': "请选择文件",
                                                'fileTypeExts': '*.jpg;*.gif;*.png;*.jpeg',
                                                'auto': false,
                                                'formData': {
                                                    'timestamp': '<?php echo $timestamp;?>',
                                                    'token': '<?php echo md5('unique_salt' . $timestamp);?>'
                                                },
                                                'swf': '/uploadify/uploadify.swf',
                                                'uploader': '/uploadify/uploadify.php',
                                                'onUploadSuccess': function (file, data, response) {
                                                    if (data != '') {
                                                        $('#File_4').val(data);
                                                        $('#PreviewPPT').html('<a target="_blank" href=' + data + '><img src=' + data + '></a>');
                                                        addPPT();
                                                    }
                                                }
                                            });
                                        });
                                    </script>

                                </td>
                            </tr>
                             <tr>
                                <td class="ltd">PPT图片预览<br/></td>
                                <td class="rtd">
                                    <ul id="pptImg" class="clearfix preview-tiems">
                                        @if(count($entBookImg)>0)
                                            @foreach($entBookImg as $dataBookImg)
                                                <li id="pptimg_{{$dataBookImg->BookImgID}}">
                                                    <img src="{{$dataBookImg->FilePath1}}">
                                                    <p onclick="ajaxDelPPTFile({{$dataBookImg->BookImgID}});" class="del-ppt">删除</p>
                                                </li>
                                            @endforeach
                                        @endif
                                    </ul>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>


                    <div class="contBtn">
                        <table class="dataTable">
                            <tfoot>
                            <tr>
                                <td class="ltd"></td>
                                <td class="rtd">
                                    <input id="btnAddFrom" onclick="return CheckindexFrom();" type="submit" class="btn btn_save"  name="btnFrom" value="保存" >
                                </td>
                            </tr>
                            </tfoot>
                        </table>
                    </div>
            	</form>	
            </div>
        </div>
	<script src="/js_system/jQueryUI/jquery-ui.js"></script>
	<script src="/js_system/jqueryui.js"></script>
    </body>
</html>